﻿<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="target-densitydpi=device-dpi, width=device-width,height=device-height, initial-scale=1, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0,shrink-to-fit=no" />
<meta name="format-detection" content="telephone=no" />
<!--em标准js代码，请放在页面的最上方，前面最好不要再有JS代码或JS文件-->
<script type="text/javascript" src="/js/rem.js"></script>
<link type="text/css" rel="stylesheet" href="/css/css.css" />
<title>东易日盛装饰开业盛典</title>
</head>

<body>		
	
	<div class="header">
		<a href="/customer/myAdministration" class="backa"></a>

		<a href="/plan/planAdd" class="adda"></a>
	</div>	

	<div class="main main2">
		<div class="wp1">
			<div class="wp2">			
				
				<div style="height:0.5rem;"></div>

				<div class="m2_fm">
					<form action="">
						<input type="search" class="text" id="keyword" name="keyword" placeholder="">
						<input type="button" value="搜索" class="sub" onclick="mysearch();">
					</form>
				</div>

				<div class="clear"></div>

				<div class="p6_fls" id="planList">

					<!--<div class="p6_fl">
						<div class="s_out">
							<ul>
								<li><div class="ti">Zance</div><span class="ct">Zance</span></li>
								<li><div class="ti">时间</div><span class="ct">2019-5-12</span></li>
								<li><div class="ti">手机号</div><span class="ct">15645874868</span></li>
								<li><div class="ti">编号</div><span class="ct">5874868</span></li>
							</ul>
							<a href="contractList.html" class="edit edit1">查看</a>
							<a href="contractList.html" class="edit edit2">修改</a>

							<div class="clear"></div>
						</div>
					</div>-->

				</div>
				<span id="msg" style="color: red;margin: 1rem"></span>
				

			</div>
		</div>
	</div>

	<img src="/images/bodysd.jpg" alt="" class="sd">
</body>
<script type="text/javascript" src="/js/jquery-1.11.1.min.js"></script>
<script type="text/javascript" src="/js/base.js"></script>
<script type="text/javascript">

	$(function () {
		planList();
	});

	function mysearch() {
		var keyword = $("#keyword").val();
		$.ajax({
			url:"/plan/mysearch",
			method:"post",
			data: {
				keyword:keyword
			},
			success:function (data) {
				$("#planList").html("");
				for(i=0;i<data.length;i++){
					console.log(data[i])
					$("#planList").append("<div onclick='planDetail("+data[i].planId+")' class=\"p6_fl\">" +
							"<div class=\"s_out\">" +
							"<ul>" +
							"<li><div class=\"ti\">客户姓名</div><span class=\"ct\">"+data[i].userName+"</span></li>" +
							"<li><div class=\"ti\">合同编码</div><span class=\"ct\">"+data[i].conCode+"</span></li>" +
							"<li><div class=\"ti\">项目经理</div><span class=\"ct\">"+data[i].manager+"</span></li>" +
							"<li><div class=\"ti\">签约日期</div><span class=\"ct\">"+data[i].conTime+"</span></li>" +
							"</ul>\n" +
							/*"<a href='\"contractList.html\"' class=\"edit edit1\">查看</a>" +
                            "<a href=\"contractList.html\" class=\"edit edit2\">修改</a>" +*/
							"<div class=\"clear\"></div>" +
							"</div>" +
							"</div>")
				}
			}
		})
	}

	function planList() {
		$("#msg").val("");
		$.ajax({
			url:"/plan/planList",
			method:"post",
			data: {},
			success:function (data) {
				if(data.msg==0){
					$("#msg").text("您还没有施工计划哟，加油！")
					$("#planList").html("")
				}
				if(data.msg==1){
					var list=data.planList;
					$("#msg").text("")
					for(i=0;i<list.length;i++){
						console.log(list[i])
						$("#planList").append("<div onclick='planDetail("+list[i].planId+")' class=\"p6_fl\">" +
								"<div class=\"s_out\">" +
								"<ul>" +
								"<li><div class=\"ti\">客户姓名</div><span class=\"ct\">"+list[i].userName+"</span></li>" +
								"<li><div class=\"ti\">合同编码</div><span class=\"ct\">"+list[i].conCode+"</span></li>" +
								"<li><div class=\"ti\">项目经理</div><span class=\"ct\">"+list[i].manager+"</span></li>" +
								"<li><div class=\"ti\">签约日期</div><span class=\"ct\">"+list[i].conTime+"</span></li>" +
								"</ul>\n" +
								/*"<a href='\"contractList.html\"' class=\"edit edit1\">查看</a>" +
								"<a href=\"contractList.html\" class=\"edit edit2\">修改</a>" +*/
								"<div class=\"clear\"></div>" +
								"</div>" +
								"</div>")
					}
				}
			}
		})
	}

	/*function planDetail() {
		var planId=$("#planId").val()
		//alert(planId)
		location.href="/plan/planDetail/"+planId;
	}*/

	function planDetail(i) {

		//alert(planId)
		location.href = "/plan/planDetail/" + i;
	}




	$(".p6_fl").each(function(){
		var that = this;

		$(that).on("touchstart", function(e) {

	　　　　//e.preventDefault();
	　　　　startX = e.originalEvent.changedTouches[0].pageX,
	　　　　startY = e.originalEvent.changedTouches[0].pageY;
	　　});
		var int;

		$(that).on("touchmove", function(e) {
	　　　　e.preventDefault();
	　　　　moveEndX = e.originalEvent.changedTouches[0].pageX,
	　　　　moveEndY = e.originalEvent.changedTouches[0].pageY,
	　　　　X = moveEndX - startX,
	　　　　Y = moveEndY - startY;
			

	　　　　if ( X < 30 ) {				
				clearTimeout(int);
				int = setTimeout(function(){
					console.log("123");
					$(".s_out",that).animate({left:"-2.2rem"},200);　　
				},50);				　　　　
	　　　　}	

			if ( X > 30 ) {
				clearTimeout(int);
				int = setTimeout(function(){
					console.log("123");
					$(".s_out",that).animate({left:"0"},200);　　
				},50);	　　　　
	　　　　}		
	　　　　
	　　　});	

	});		
	

</script>
</html>